home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.9 KB | 52 lines | [TEXT/GEOL] |
- Item 2885047 3-Jan-91 10:41PST
-
- From: PERRY.G Gregg, Perry
-
- To: PHIL.TH Thompson, Phil
- CATHERS Cathers, Jeff
- PIRO Paoletti, Giovanni
- MACAPP.TECH$ MacApp Technical
-
- cc: JERNIGAN1 Jernigan, Ginger
-
- ------------------------------------------------------------------------------
-
- Sub: Re: ? Implementing OK Button
-
- Mike,
-
- One of the original design themes of MacApp was that those class methods that
- start with Do…, like DoChoice are methods we mere mortal hackers may be
- interested in OVERRIDE-ing. So always search for an easy way to do it in a Do…
- something method first.
-
- So you could do something like the following in TYourDialogView.DoChoice:
-
- mButtonHit: { This handles clicking in 'OK' or 'Cancel'
- buttons }
- BEGIN
- IF origView.fIdentifier = fDefaultItem THEN
- BEGIN
- {... Do your dialogs main purpose here, or create a command to do it.}
- GetWindow.Close;
- END
- ELSE IF origView.fIdentifier = fCancelItem THEN
- GetWindow.Close;
-
- TChoiceButton would be overkill. Generally, you only want to design classes
- for things MacApp doesn't do for you. MacApp handles almost everthing
- regarding displaying a button in a dialog and choosing it. It doesn't however
- do the work your app thinks the dialog should do. So your class if any for
- choosing buttons might be related to and modelled after the action you want
- done (TWorkIDoWhenThisButtonHitCommand, etc.). You would instantiate the
- command at the comment above under the fDefaultItem case.
-
- Of course, there is no right way to do the things you want your app to do. The
- above is just a path of small resistance.
-
- -- Perry
-
- P.S. You could override DismissDialog and check the dismisser. This method
- could have been named DoDismissDialog.
-
-